window.addEventListener("load", function () {
	// 顶栏点击事件
	const a = document.querySelector(".topPreset a")
	a.addEventListener("touchstart", function () {
		history.back()
	})

	const outBox = document.querySelector(".allowed .right .out-box")
	const innerBox = document.querySelector(".allowed .right .inner-box")
	//给a注册点击事件
	let boxLeft = false
	boxLeft = JSON.parse(localStorage.getItem("isNotify")) && true
	convert()
	outBox.addEventListener("touchstart", function () {
		boxLeft = !boxLeft
		convert()
	})
	function convert() {
		innerBox.style.marginLeft = boxLeft ? 31 / 37.5 + "rem" : 6 / 37.5 + "rem"
		outBox.style.backgroundColor = boxLeft ? "red" : "#EDEDED"
		localStorage.setItem("isNotify", JSON.stringify(boxLeft))
	}
})
